import time

from selenium import webdriver


def regUser(username):
    driver = webdriver.Chrome()
    driver.get("http://www.73bt.com/w/167/498")

    driver.find_element_by_name('username').send_keys(username)
    driver.find_element_by_name('password').send_keys('hy15800')
    driver.find_element_by_css_selector(".btn.btn-submit").click()

    time.sleep(10)

    driver.find_element_by_id('RealName').send_keys("徐炳华")
    driver.find_element_by_id('IdCard').send_keys("320511195410150057")
    driver.find_element_by_css_selector('.btn.btn-major.j-submit').click()

    time.sleep(3)
    driver.quit()


for i in range(5):
    username = 'hy' + str(189+i)
    regUser(username)
    time.sleep(1)
    print(username)

